home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / GRAHAM / XA_6S.ZIP / SOURCE / GRAFGROW.C < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-29  |  2.0 KB  |  110 lines

  1. /*
  2.  * XaAES - XaAES Ain't the AES
  3.  *
  4.  * A multitasking AES replacement for MiNT
  5.  *
  6.  */
  7.  
  8. #include <VDI.H>
  9. #include <OSBIND.H>
  10. #include "XA_DEFS.H"
  11. #include "XA_TYPES.H"
  12. #include "XA_GLOBL.H"
  13. #include "OBJECTS.H"
  14.  
  15. unsigned long XA_graf_growbox(short clnt_pid, AESPB *pb)
  16. {
  17.     short x=pb->intin[0];
  18.     short y=pb->intin[1];
  19.     short w=pb->intin[2];
  20.     short h=pb->intin[3];
  21.     short xe=pb->intin[4];
  22.     short ye=pb->intin[5];
  23.     short we=pb->intin[6];
  24.     short he=pb->intin[7];
  25.     short dx,dy,dw,dh;
  26.     short f;
  27.     
  28.     dx=(xe-x)/GRAF_STEPS;
  29.     dy=(ye-y)/GRAF_STEPS;
  30.     dw=(we-w)/GRAF_STEPS;
  31.     dh=(he-h)/GRAF_STEPS;
  32.  
  33.     vswr_mode(V_handle, MD_XOR);
  34.  
  35.     v_hide_c(V_handle);
  36.  
  37.     for(f=0; f<GRAF_STEPS; f++)            /* Draw initial growing outline */
  38.     {
  39.         draw_2d_box(x, y, w, h, 1, BLACK);
  40.         x+=dx; y+=dy;
  41.         w+=dw; h+=dh;
  42.         if (f%2) Vsync();
  43.     }
  44.     
  45.     x=pb->intin[0];                        /* reset to initial area */
  46.     y=pb->intin[1];
  47.     w=pb->intin[2];
  48.     h=pb->intin[3];
  49.  
  50.     for(f=0; f<GRAF_STEPS; f++)            /* Erase growing outline */
  51.     {
  52.         draw_2d_box(x, y, w, h, 1, BLACK);
  53.         x+=dx; y+=dy;
  54.         w+=dw; h+=dh;
  55.         if (f%2) Vsync();
  56.     }
  57.  
  58.     v_show_c(V_handle, 1);
  59.  
  60.     vswr_mode(V_handle,MD_TRANS);
  61.     
  62.     pb->intout[0]=1;
  63.     
  64.     return XAC_DONE;
  65. }
  66.  
  67. unsigned long XA_graf_movebox(short clnt_pid, AESPB *pb)
  68. {
  69.     short w=pb->intin[0];
  70.     short h=pb->intin[1];
  71.     short x=pb->intin[2];
  72.     short y=pb->intin[3];
  73.     short xe=pb->intin[4];
  74.     short ye=pb->intin[5];
  75.     short dx,dy;
  76.     short f;
  77.     
  78.     dx=(xe-x)/GRAF_STEPS;
  79.     dy=(ye-y)/GRAF_STEPS;
  80.  
  81.     vswr_mode(V_handle, MD_XOR);
  82.  
  83.     v_hide_c(V_handle);
  84.  
  85.     for(f=0; f<GRAF_STEPS; f++)        /* Draw initial images */
  86.     {
  87.         draw_2d_box(x, y, w, h, 1, BLACK);
  88.         x+=dx; y+=dy;
  89.         if (f%2) Vsync();
  90.     }
  91.     
  92.     x=pb->intin[2];                    /* Reset to go back over same area */
  93.     y=pb->intin[3];
  94.  
  95.     for(f=0; f<GRAF_STEPS; f++)        /* Erase them again */
  96.     {
  97.         draw_2d_box(x, y, w, h, 1, BLACK);
  98.         x+=dx; y+=dy;
  99.         if (f%2) Vsync();
  100.     }
  101.  
  102.     v_show_c(V_handle, 1);
  103.  
  104.     vswr_mode(V_handle,MD_TRANS);
  105.     
  106.     pb->intout[0]=1;
  107.     
  108.     return XAC_DONE;
  109. }
  110.